import Register from "./Register";
import Alu from "./Alu";

class CPU {
    constructor(param) {
        this.registerList = []; //gprs
        this.alu = new Alu();
        this.cu = new Cu();

    }

    initRegisterList(){
        let that = this;
        that.registerList.push(new Register({
            name:'ax',
        }));
        that.registerList.push(new Register({
            name:'bx',
        }));
        that.registerList.push(new Register({
            name:'cx',
        }));
        that.registerList.push(new Register({
            name:'dx',
        }));

        that.registerList.push(new Register({
            name:'cs',
        }));
        that.registerList.push(new Register({
            name:'ip',
        }));
        that.registerList.push(new Register({
            name:'ds',
        }));
        that.registerList.push(new Register({
            name:'dp',
        }));
        that.registerList.push(new Register({
            name:'ss',
        }));
        that.registerList.push(new Register({
            name:'sp',
        }));

    }
}
export default CPU;
